package com.mgq.juc.c1;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * @author MaGuangQi
 * @description
 * @date 2021-12-13 16:31
 **/
@Slf4j(topic = "")
public class TestFutureTask {
    public static void main(String[] args) {
        FutureTask<Integer> futureTask=new FutureTask<Integer>(new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                log.debug("running............");
                return 100;
            }
        });

        Thread t1 = new Thread(futureTask, "t1");
        t1.start();
    }
}
